package com.web;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.model.UserInfo;
import com.service.UserInfoService;

@Controller
@RequestMapping("/userAction")
public class UserInfoAction {
	
	@Resource
	private UserInfoService us;

	public UserInfoService getUs() {
		return us;
	}

	public void setUs(UserInfoService us) {
		this.us = us;
	}
	
	@RequestMapping(value="/listAll")
	public String listUser(HttpServletRequest request) {
		List<UserInfo> list = us.listAll();
		request.setAttribute("userlist", list);
		return "index";
	}

}
